import { defineStore } from 'pinia'
import { ref } from "vue"
export const useUserStore = defineStore(
    'user',
    () => {
        let token = ref('')
        const setToken = (data) => {
            token.value = data
        }

        return {
            token,
            setToken
        }
    },
    // TODO: 持久化
    {
        // 网页端的配置
        // persist: true,
        persist: {
            storage: sessionStorage,
            // pick: ['token'],
        }
    },
)